package com.huawei.appgallery.forum.option.api;

import android.content.Context;
import android.content.Intent;
import com.huawei.secure.android.common.intent.SafeIntent;
import java.util.List;
import o.bqx;
import o.byd;
import o.dyr;
import o.dys.a;
import o.fho;
import o.fjb;

public class ForumPublishPostAction extends dyr {
    public static final String ACTION = "com.huawei.appmarket.intent.action.forum.publish.post";
    public static final String BUNDLE_DOMAINID = "DomainId";
    public static final String BUNDLE_LISTPOSTUNITDATA = "ListPostUnitData";
    public static final String BUNDLE_POSTID = "PostId";
    public static final String BUNDLE_POSTMODIFY = "PostModify";
    public static final String BUNDLE_POSTTITLE = "PostTitle";
    public static final String BUNDLE_SECTIONID = "SectionId";
    private static final String TAG = "ForumPublishPostAction";

    public ForumPublishPostAction(a aVar) {
        super(aVar);
    }

    public void onAction() {
        bqx.ˊ(TAG, "onAction");
        Intent safeIntent = new SafeIntent(this.callback.getIntent());
        List list = null;
        if (safeIntent.getSerializableExtra("ListPostUnitData") instanceof List) {
            list = (List) safeIntent.getSerializableExtra("ListPostUnitData");
        }
        fjb ˎ = fho.ˏ().ˋ("Option").ˎ("option.publish");
        byd o_byd = new byd(safeIntent.getIntExtra("SectionId", -1), safeIntent.getLongExtra("PostId", -1), safeIntent.getStringExtra("PostTitle"), list);
        String stringExtra = safeIntent.getStringExtra("DomainId");
        if (this.callback instanceof Context) {
            IPublishPostActivityProtocol iPublishPostActivityProtocol = (IPublishPostActivityProtocol) ˎ.ˊ();
            if (safeIntent.getBooleanExtra("PostModify", false)) {
                iPublishPostActivityProtocol.setIsUpdate(true);
            } else {
                iPublishPostActivityProtocol.setIsUpdate(false);
            }
            iPublishPostActivityProtocol.setPublishData(o_byd);
            iPublishPostActivityProtocol.setDomainId(stringExtra);
            Intent intent = new Intent();
            intent.addFlags(33554432);
            this.callback.ˏ(ˎ, intent);
            this.callback.finish();
            return;
        }
        bqx.ॱ(TAG, "!callback instanceof Context");
        this.callback.finish();
    }
}
